from django.db import models

# Create your models here.
from domain.models import Domain

class New(models.Model):
    title = models.CharField(max_length=200, verbose_name="新闻标题")
    content = models.TextField(verbose_name="新闻内容")
    domain = models.ForeignKey(Domain, on_delete=models.CASCADE, related_name="news", verbose_name="所属领域")
    created_at = models.DateTimeField(auto_now_add=True, verbose_name="创建时间")
    updated_at = models.DateTimeField(auto_now=True, verbose_name="更新时间")

    def __str__(self):
        return self.title